import { PORT_CareMissionCategorize } from "@/api/config/servicePort";
import http from "@/api";
import type { CareMission } from "@/api/interface";

/**
 * @name 公司管理模块
 */
// 获取护理项目分类列表（分页）
export const getCareMissionCategorizeList = (param: CareMission.ReqCareMissionCategorizeListParams) => {
  return http.post<CareMission.ResCareMissionCategorize[]>(PORT_CareMissionCategorize + `/list`, param);
};

/**
 * 照护项目分类保存
 * @param data 照护项目分类保存请求参数
 * @returns 照护项目分类保存响应参数
 */
export const saveCareMissionCategorize = (data: CareMission.ReqCareMissionCategorizeSaveParams) => {
  return http.post<number>(PORT_CareMissionCategorize + `/save`, data);
};

/**
 * 照护项目分类删除
 * @param id 照护项目分类id
 * @returns 照护项目分类删除响应参数
 */
export const deleteCareMissionCategorize = (id: number) => {
  return http.post<boolean>(PORT_CareMissionCategorize + `/delete?id=${id}`);
};

/**
 * 照护项目分类排序
 * @param data 照护项目分类排序请求参数
 * @returns 照护项目分类排序响应参数
 */
export const sortCareMissionCategorize = (data: CareMission.ReqCareMissionCategorizeSortParams) => {
  return http.post<boolean>(PORT_CareMissionCategorize + `/sort`, data);
};
